# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Content.V21.Model.ProductCluster do
  @moduledoc """
  Product cluster fields. A product cluster is a grouping for different offers that represent the same product. Values are only set for fields requested explicitly in the request's search query.

  ## Attributes

  *   `brand` (*type:* `String.t`, *default:* `nil`) - Brand of the product cluster.
  *   `brandInventoryStatus` (*type:* `String.t`, *default:* `nil`) - Tells if there is at least one product of the brand currently `IN_STOCK` in your product feed across multiple countries, all products are `OUT_OF_STOCK` in your product feed, or `NOT_IN_INVENTORY`. The field doesn't take the Best Sellers report country filter into account.
  *   `categoryL1` (*type:* `String.t`, *default:* `nil`) - Product category (1st level) of the product cluster, represented in Google's product taxonomy.
  *   `categoryL2` (*type:* `String.t`, *default:* `nil`) - Product category (2nd level) of the product cluster, represented in Google's product taxonomy.
  *   `categoryL3` (*type:* `String.t`, *default:* `nil`) - Product category (3rd level) of the product cluster, represented in Google's product taxonomy.
  *   `categoryL4` (*type:* `String.t`, *default:* `nil`) - Product category (4th level) of the product cluster, represented in Google's product taxonomy.
  *   `categoryL5` (*type:* `String.t`, *default:* `nil`) - Product category (5th level) of the product cluster, represented in Google's product taxonomy.
  *   `inventoryStatus` (*type:* `String.t`, *default:* `nil`) - Tells whether the product cluster is `IN_STOCK` in your product feed across multiple countries, `OUT_OF_STOCK` in your product feed, or `NOT_IN_INVENTORY` at all. The field doesn't take the Best Sellers report country filter into account.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Title of the product cluster.
  *   `variantGtins` (*type:* `list(String.t)`, *default:* `nil`) - GTINs of example variants of the product cluster.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :brand => String.t() | nil,
          :brandInventoryStatus => String.t() | nil,
          :categoryL1 => String.t() | nil,
          :categoryL2 => String.t() | nil,
          :categoryL3 => String.t() | nil,
          :categoryL4 => String.t() | nil,
          :categoryL5 => String.t() | nil,
          :inventoryStatus => String.t() | nil,
          :title => String.t() | nil,
          :variantGtins => list(String.t()) | nil
        }

  field(:brand)
  field(:brandInventoryStatus)
  field(:categoryL1)
  field(:categoryL2)
  field(:categoryL3)
  field(:categoryL4)
  field(:categoryL5)
  field(:inventoryStatus)
  field(:title)
  field(:variantGtins, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.Content.V21.Model.ProductCluster do
  def decode(value, options) do
    GoogleApi.Content.V21.Model.ProductCluster.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Content.V21.Model.ProductCluster do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
